package com.zh.test.controller;


import com.zh.test.bean.OutJson;
import com.zh.test.exception.ErrorEnum;
import com.zh.test.exception.NotFoundInventoryException;
import com.zh.test.service.noBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/path")

public class PathController {
    Logger log = LoggerFactory.getLogger(PathController.class);
    @Autowired
    noBean noBean;

    @GetMapping("path")
    public void test1() {
        log.info("get");
    }

    @PostMapping
    public void test2() {
        log.info("post");
    }

    @DeleteMapping
    public void test3() {
        log.info("post2");
        noBean.show();
    }
    @GetMapping("/test14")
    public OutJson test14() throws NotFoundInventoryException {
        throw  new NotFoundInventoryException(ErrorEnum.ERROR);

    }
    @GetMapping("/test15")
    public OutJson test15() throws Exception{
        throw  new Exception();

    }
}
